常用 Linux 命令速查

开发中经常用到的终端命令

熟练使用命令行能大幅提升开发效率。以下是一些常用命令的速查。

文件操作

bash
# 查找文件
find . -name "*.ts" -type f
 
# 搜索内容
grep -r "keyword" ./src
 
# 批量重命名
rename 's/old/new/' *.txt

进程管理

bash
# 查看占用端口的进程
lsof -i :3000
 
# 杀死进程
kill -9 <pid>

磁盘与网络

bash
# 磁盘使用
du -sh *
df -h
 
# 网络测试
curl -I https://example.com

Go back Home.